//
//  FQCerificationTipView.swift
//  SwiftProject
//
//  Created by 董駸 on 2022/8/22.
//

import UIKit

class FQCerificationTipView: UIView {

    convenience init(_ type : Int) {
        self.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 72 + 77~))
        
        let titleLb = QMUILabel(font: .rSFont(13), textColor: .color102)
        addSubview(titleLb)
        
        titleLb.snp.makeConstraints { make in
            make.left.equalTo(20)
            make.top.equalToSuperview()
        }
        
        let image = UIImageView()
        addSubview(image)
        
        image.snp.makeConstraints { make in
            make.left.equalTo(20)
            make.right.equalTo(-20)
            make.top.equalTo(titleLb.snp.bottom).offset(15)
            make.height.equalTo(77~)
        }
        
        if type == 0 {
            image.image = UIImage(named: "icon_tipView")
            backgroundColor = .clear
            titleLb.text = "上传须知"
            
            let button = ArrowButton(arrowSize: CGSize(width: 4, height: 7), arrowColor: .color102, arrowDirection: .right, lineWidth: 1)
            button.imagePosition = .right
            button.spacingBetweenImageAndTitle = 5
            button.titleLabel?.font = .rSFont(13)
            button.setTitle("更多帮助", for: .normal)
            button.setTitleColor(.color102, for: .normal)
            addSubview(button)
            
            button.snp.makeConstraints { make in
                make.right.equalTo(-20)
                make.centerY.equalTo(titleLb)
            }
        } else if type == 1 {
            image.image = UIImage(named: "icon_tipView")
            titleLb.text = "拍摄须知"
            backgroundColor = .white
        } else {
            image.image = UIImage(named: "icon_faceTip")
            titleLb.text = "拍摄须知"
            backgroundColor = .clear
        }
    }
}
